# config.py

# --- Milvus 数据库设置 ---
MILVUS_HOST = "10.3.244.23"
MILVUS_PORT = "8001"
MILVUS_COLLECTION = "rag_documents_v1"
MILVUS_COLLECTION_IMAGE = "rag_images_v1"  # 图片向量集合

# --- 阿里云 OSS 账号信息 ---
ALIYUN_OSS_ACCESS_KEY_ID = "LTAI5tLm9VNHqQG2w6p2ceJj"
ALIYUN_OSS_ACCESS_KEY_SECRET = "TxZMYPzxh5krlNwSlMmLdJiDdQ8Uok"
ALIYUN_OSS_BUCKET_DATASET = "dataset-square-migrate"
ALIYUN_OSS_BUCKET_STUDY = "study-square-migrate"
ALIYUN_OSS_REGION = "oss-cn-beijing"

# --- 百炼RAG账号信息 ---
BAILIAN_API_KEY = "sk-38b9daad5d5e46f690545046695bd6ff"
BAILIAN_USER = "ehaihong@1773431696074921.onaliyun.com"
BAILIAN_PASSWORD = "Bupt@2024"
BAILIAN_URL = "https://bailian.console.aliyun.com"

# --- 嵌入模型设置 ---
EMBEDDING_MODEL = 'text-embedding-v4'  # 阿里云百炼 embedding
MULTIMODAL_EMBEDDING_MODEL = 'multimodal-embedding-v1'  # 多模态嵌入模型
VECTOR_DIMENSION = 1536  # 文本向量维度
IMAGE_VECTOR_DIMENSION = 1024  # 图片向量维度

# --- 文本切分设置 ---
CHUNK_SIZE = 250
CHUNK_OVERLAP = 50

# --- 大语言模型设置 ---
LLM_MODEL = "qwen-turbo"  # 百炼RAG大模型
LLM_API_KEY = BAILIAN_API_KEY
LLM_API_URL = "https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation"

# --- RAG (检索增强生成) 设置 ---
TOP_K = 10
SIMILARITY_THRESHOLD = 0.5

# --- Celery 配置 ---
CELERY_BROKER_URL = "redis://10.3.244.23:36379/6"
CELERY_RESULT_BACKEND = "redis://10.3.244.23:36379/6"
CELERY_TASK_SERIALIZER = "json"
CELERY_RESULT_SERIALIZER = "json"
CELERY_ACCEPT_CONTENT = ["json"]
CELERY_TIMEZONE = "Asia/Shanghai"
CELERY_ENABLE_UTC = True

# --- 文件上传配置 ---
UPLOAD_FOLDER = "uploads"
MAX_FILE_SIZE = 100 * 1024 * 1024  # 100MB
ALLOWED_EXTENSIONS = {
    'text': ['.txt', '.md', '.csv'],
    'document': ['.pdf', '.docx', '.pptx'],
    'image': ['.jpg', '.jpeg', '.png', '.bmp', '.gif'],
    'video': ['.mp4', '.avi', '.mov', '.mkv']
}

# --- 任务状态 ---
TASK_STATUS_PENDING = "pending"
TASK_STATUS_PROCESSING = "processing"
TASK_STATUS_COMPLETED = "completed"
TASK_STATUS_FAILED = "failed"